# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.BareMetalSolution.V2.Model.ServerNetworkTemplate do
  @moduledoc """
  Network template.

  ## Attributes

  *   `applicableInstanceTypes` (*type:* `list(String.t)`, *default:* `nil`) - Instance types this template is applicable to.
  *   `logicalInterfaces` (*type:* `list(GoogleApi.BareMetalSolution.V2.Model.GoogleCloudBaremetalsolutionV2ServerNetworkTemplateLogicalInterface.t)`, *default:* `nil`) - Logical interfaces.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Output only. Template's unique name. The full resource name follows the pattern: `projects/{project}/locations/{location}/serverNetworkTemplate/{server_network_template}` Generally, the {server_network_template} follows the syntax of "bond" or "nic".
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :applicableInstanceTypes => list(String.t()) | nil,
          :logicalInterfaces =>
            list(
              GoogleApi.BareMetalSolution.V2.Model.GoogleCloudBaremetalsolutionV2ServerNetworkTemplateLogicalInterface.t()
            )
            | nil,
          :name => String.t() | nil
        }

  field(:applicableInstanceTypes, type: :list)

  field(:logicalInterfaces,
    as:
      GoogleApi.BareMetalSolution.V2.Model.GoogleCloudBaremetalsolutionV2ServerNetworkTemplateLogicalInterface,
    type: :list
  )

  field(:name)
end

defimpl Poison.Decoder, for: GoogleApi.BareMetalSolution.V2.Model.ServerNetworkTemplate do
  def decode(value, options) do
    GoogleApi.BareMetalSolution.V2.Model.ServerNetworkTemplate.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.BareMetalSolution.V2.Model.ServerNetworkTemplate do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
